import {HTTP} from "../utils/http.js";

export class LikeModel extends HTTP {
    live(state, id, type) {
        let url = state == 'like' ? 'like' : 'like/cancel'
        this.request({
            url: url,
            method: 'POST',
            data: {
                art_id: id,
                type: type
            }
        })
    }

    getClassicLikeStatus(artID, categoy, sCallback) {
        this.request({
            url: `classic/${categoy}/${artID}/favor`,
            success: res=>{
                sCallback(res)
            }
        })
    }
}